package com.baizhi.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

public class User {
    private Integer userId;

    private String email;

    private String password;

    private String salt;

    private String nickname;

    private Integer status;

    private String code;
    //注册日期
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private Date addDate;

    private List<Order> orders;

    private List<Address> ads;

    public User(Integer userId, String email, String password, String salt, String nickname, Integer status, String code, Date addDate) {
        this.userId = userId;
        this.email = email;
        this.password = password;
        this.salt = salt;
        this.nickname = nickname;
        this.status = status;
        this.code = code;
        this.addDate = addDate;
    }

    public User() {
        super();
    }


    public List<Address> getAds() {
		return ads;
	}

	public void setAds(List<Address> ads) {
		this.ads = ads;
	}

	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}

	public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getAddDate() {
        return addDate;
    }

    public void setAddDate(Date addDate) {
        this.addDate = addDate;
    }

	@Override
	public String toString() {
		return "User [userId=" + userId + ", email=" + email + ", password=" + password + ", salt=" + salt
				+ ", nickname=" + nickname + ", status=" + status + ", code=" + code + ", addDate=" + addDate
				+ ", orders=" + orders + "]";
	}

}